The detection of objects by optical methods can make use of more or less sophisticated means, notably comprising an image capture with an electronic image sensor and a later complex processing of the image (shape recognition, etc.) in order to carry out a counting of objects present in the image.